import pygame.sprite
# To change this template, choose Tools | Templates
# and open the template in the editor.

__author__="james"
__date__ ="$27/04/2011 7:46:50 PM$"

from actors.Player import Player
from actors.Enemy_Simple import Enemy_Simple
from stages.Stage import Stage
from weapons.Basic_Weapon import Basic_Weapon
import pygame, sys, os, random

class Stage_1(Stage):
    def __init__(self):
        Stage.__init__(self)
        #setup the player
        self.player = Player(self)
        #give basic weapon
        self.player.get_weapon(Basic_Weapon(self))
        self.all_sprites = pygame.sprite.Group(self.player)
        #self.all_sprites = pygame.sprite.RenderPlain((self.player, Enemy_Simple(self)))

    def update(self, events):        
        for event in events:
            if event.type == pygame.MOUSEBUTTONDOWN:
                #player fire
                self.player.fire()
                pass
        if random.randrange(0,40) == 10:
            enemy = Enemy_Simple(self)
            enemy.set_postion((random.randrange(50,750), random.randrange(50,100)))
            self.all_sprites.add(enemy)
        Stage.update(self,events)

